"""
HiAgent Chat SDK 安装配置文件
"""

from setuptools import setup, find_packages
import os

# 读取README文件
def read_readme():
    readme_path = os.path.join(os.path.dirname(__file__), 'README.md')
    if os.path.exists(readme_path):
        with open(readme_path, 'r', encoding='utf-8') as f:
            return f.read()
    return "HiAgent Chat SDK - Python客户端库"

# 读取requirements文件
def read_requirements():
    requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
    if os.path.exists(requirements_path):
        with open(requirements_path, 'r', encoding='utf-8') as f:
            return [line.strip() for line in f if line.strip() and not line.startswith('#')]
    return [
        'requests>=2.25.0',
        'urllib3>=1.26.0',
        'dataclasses>=0.6;python_version<"3.7"'
    ]

setup(
    name="hiagent-chat",
    version="1.0.0",
    author="HiAgent Team",
    author_email="support@hiagent.com",
    description="HiAgent Chat SDK - Python客户端库",
    long_description=read_readme(),
    long_description_content_type="text/markdown",
    url="https://github.com/hiagent/hiagent-chat-python",
    packages=find_packages(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
        "Topic :: Communications :: Chat",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
    ],
    python_requires=">=3.6",
    install_requires=read_requirements(),
    extras_require={
        "dev": [
            "pytest>=6.0",
            "pytest-cov>=2.0",
            "black>=21.0",
            "flake8>=3.8",
            "mypy>=0.800",
            "pre-commit>=2.0",
        ],
        "docs": [
            "sphinx>=3.0",
            "sphinx-rtd-theme>=0.5",
            "myst-parser>=0.15",
        ],
    },
    entry_points={
        "console_scripts": [
            "hiagent-chat=hiagent_chat.cli:main",
        ],
    },
    include_package_data=True,
    package_data={
        "hiagent_chat": [
            "*.md",
            "*.txt",
            "*.yml",
            "*.yaml",
        ],
    },
    keywords=[
        "hiagent",
        "chat",
        "ai",
        "chatbot",
        "conversation",
        "api",
        "sdk",
        "client",
        "python",
    ],
    project_urls={
        "Bug Reports": "https://github.com/hiagent/hiagent-chat-python/issues",
        "Source": "https://github.com/hiagent/hiagent-chat-python",
        "Documentation": "https://hiagent-chat-python.readthedocs.io/",
    },
)